package com.zyh.homework.test3;

import java.io.*;

/**
 * @Author zyh
 * @Date 2024/8/5 19:07
 * @Description 把如下这些数据存放到一个data.txt文件中，并且再次读取显示
 * int a = 10;
 * char c = 'a';
 * double d = 2.5;
 * boolean b = true;
 * String str = "软帝联合";
 */

public class Test3 {
    public static void main(String[] args) throws IOException {
        /*int a = 10;
        char c = 'a';
        double d = 2.5;
        boolean b = true;
        String str = "软帝联合";
        String s=a+c+Double.valueOf(d).toString()+b+str;
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\Code\\IDEA\\idea_projects\\JavaSE-plus\\day09-code\\src\\com\\zyh\\homework\\test3\\testIO\\data.txt"));
        bw.write(s);*/
        BufferedReader br = new BufferedReader(new FileReader("D:\\Code\\IDEA\\idea_projects\\JavaSE-plus\\day09-code\\src\\com\\zyh\\homework\\test3\\testIO\\data.txt"));
        String line=null;
        while ((line=br.readLine())!=null){
            System.out.println(line);
        }
        br.close();
       /*bw.flush();
        bw.close();*/
    }
}
